import Base64 from "./base64.js"
import Parse from "./parse.js"

export default async function(res) {
  const parse = new Parse.getInstance();
  const info = await parse.parseCode(res).catch((e) => {
    uni.hideLoading()
    return parse.scanCode(true, {
      title: '( •̀ ω •́ )✧',
      showCancel: false,
      content: '亲，您扫的码不对哦~',
      confirmText: '重新扫码',
    })
  })
  
  uni.hideLoading();
  uni.redirectTo({
    url: "/pages/list/list"
  })
  return info
}
